#include <vector>
#include <iostream>
using namespace std;
vector<vector<int>> powerSet(vector<int> array) {
    vector<vector<int>> result {{}};
    for (int number : array) {
        int length = result.size();
        for (int i = 0; i < length; ++i) {
            vector<int> tmp = result[i];
            tmp.push_back(number);
            result.push_back(tmp);
        }
    }
    return result;
}
int main(int argc, char const *argv[]) {
    vector<int> value {1,2,3};
    vector<vector<int>> result = powerSet(value);
    for (vector<int> v : result) {
        cout<<"[";
        for (int n : v) {
            cout<<n<<" ";
        }
        cout<<"]";
    }
}